import id2md5 from './id-md5';

export function openReader(e){
  const {reader_url,id,article_id} = e;
  const idmd5 = id2md5(id||article_id)
  // const url = `${$cfgs.srv.url}/kms/doc/rd/#/view/${idmd5}`;
  const url = `${$cfgs.srv.url}${reader_url}${idmd5}`;
  url && window.open(url, '_blank');
}

export function openEditor(e){
  const {editor_url,id,article_id} = e;
  const idmd5 = id2md5(id||article_id)
  // const url = `${$cfgs.srv.url}/kms/doc/ed/#/edit/${idmd5}`;
  const url = `${$cfgs.srv.url}${editor_url}${idmd5}`;
  url && window.open(url, '_blank');
}

